package com.ruoyi.buy.service.impl;

import com.ruoyi.buy.domain.entity.PO.BuyPurchasePostItem;
import com.ruoyi.buy.mapper.PO.BuyPurchasePostItemMapper;
import com.ruoyi.buy.service.IBuyPurchasePostItemService;
import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * 物流明细Service业务层处理
 * 
 * @author ruoyi
 * @date 2023-12-18
 */
@Service
public class BuyPurchasePostItemServiceImpl implements IBuyPurchasePostItemService
{
    @Autowired
    private BuyPurchasePostItemMapper buyPurchasePostItemMapper;

    /**
     * 查询物流明细
     * 
     * @param id 物流明细主键
     * @return 物流明细
     */
    @Override
    public BuyPurchasePostItem selectBuyPurchasePostItemById(String id)
    {
        return buyPurchasePostItemMapper.selectBuyPurchasePostItemById(id);
    }

    /**
     * 查询物流明细列表
     * 
     * @param buyPurchasePostItem 物流明细
     * @return 物流明细
     */
    @Override
    public List<BuyPurchasePostItem> selectBuyPurchasePostItemList(BuyPurchasePostItem buyPurchasePostItem)
    {
        return buyPurchasePostItemMapper.selectBuyPurchasePostItemList(buyPurchasePostItem);
    }

    /**
     * 新增物流明细
     * 
     * @param buyPurchasePostItem 物流明细
     * @return 结果
     */
    @Override
    public int insertBuyPurchasePostItem(BuyPurchasePostItem buyPurchasePostItem)
    {
        buyPurchasePostItem.setCreateTime(DateUtils.getNowDate());
        return buyPurchasePostItemMapper.insertBuyPurchasePostItem(buyPurchasePostItem);
    }

    /**
     * 修改物流明细
     * 
     * @param buyPurchasePostItem 物流明细
     * @return 结果
     */
    @Override
    public int updateBuyPurchasePostItem(BuyPurchasePostItem buyPurchasePostItem)
    {
        buyPurchasePostItem.setUpdateTime(DateUtils.getNowDate());
        return buyPurchasePostItemMapper.updateBuyPurchasePostItem(buyPurchasePostItem);
    }

    /**
     * 批量删除物流明细
     * 
     * @param ids 需要删除的物流明细主键
     * @return 结果
     */
    @Override
    public int deleteBuyPurchasePostItemByIds(String[] ids)
    {
        return buyPurchasePostItemMapper.deleteBuyPurchasePostItemByIds(ids);
    }

    /**
     * 删除物流明细信息
     * 
     * @param id 物流明细主键
     * @return 结果
     */
    @Override
    public int deleteBuyPurchasePostItemById(String id)
    {
        return buyPurchasePostItemMapper.deleteBuyPurchasePostItemById(id);
    }
}
